package com.psg.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "Produce")
public class Produce implements Serializable , Comparable<Produce> {
    /**
     * 商品信息
     */
    @TableId(value = "pId",type = IdType.AUTO)
    private Integer pId;                    //商品编号
    private String shortName;               //短商品名称
    private String productName;             //商品名
    private String indroduce;               //商品介绍
    private Float weight;                   //商品毛重
    private String born;                    //商品产地
    private String weightInterval;         //一份大概重量
    private String isImport;               //是否进口 0代表是，1代表否
    private Integer category;                //分类
    private String packaging;               //包装
    private String img;                     //图片
    private Float price;                    //单价
    private String unit;                    //商品单位
    private String productUnit;             //单位

    public Integer getpId() {
        return pId;
    }

    public void setpId(Integer pId) {
        this.pId = pId;
    }


    @Override
    public int compareTo(com.psg.pojo.Produce o) {
        Float price = o.getPrice();
        return (int)(this.price-price);
    }
}
